﻿function mCheckAll(spanChk,ChkName)
{
  elm= document.getElementsByName(ChkName);
   if(elm!=null)
   {
   for(i=0;i<elm.length;i++)
    elm[i].checked=spanChk.checked;
   }

} 
function mIsSelected(ChkName)
{
    elm= document.getElementsByName(ChkName);
    var iChecked=0;
    if(elm!=null)
    {
        for(i=0;i<elm.length;i++)
        {
            if(elm[i].checked)
            {
                iChecked++;
            }
        }
    }
    else        
    {
        return false;
    }
    if(iChecked == 0)
    {
        return false;
    }
    else
    {
        return true;
    }
}
function mCanDelete(ChkName,pMsg)
{
    var isSelect = mIsSelected(ChkName);
    if(!isSelect)
    {
        window.alert(pMsg);
        return false;
    }
    return true;
}